
// import oimo.collision.geometry.Geometry;
// import oimo.common.Mat3;
// import oimo.common.Setting;
// import oimo.common.Vec3;
// import oimo.dynamics.callback.ContactCallback;

import { Vec3 } from "../../common/Vec3";
import { Mat3 } from "../../common/Mat3";
import { Setting } from "../../common/Setting";
import { Geometry } from "../../collision/geometry/Geometry";
import { ContactCallback } from "../callback/ContactCallback";

/**
 * A shape configuration is used for construction of shapes. An instance of
 * this class can safely be reused as a shape will not have any references
 * of a field of this class.
 */
export class ShapeConfig {
	/**
	 * The shape's local position relative to the parent rigid body's origin.
	 */
	position: Vec3;

	/**
	 * The shape's local rotation matrix relative to the parent rigid body's
	 * rotation.
	 */
	rotation: Mat3;

	/**
	 * The coefficient of friction of the shape.
	 */
	friction: number;

	/**
	 * The coefficient of restitution of the shape.
	 */
	restitution: number;

	/**
	 * The density of the shape, usually in Kg/m^3.
	 */
	density: number;

	/**
	 * The collision geometry of the shape.
	 */
	geometry: Geometry;

	/**
	 * The collision group bits the shape belongs to. This is used for collision
	 * filtering.
	 *
	 * Two shapes `shape1` and `shape2` will collide only if both
	 * `shape1.collisionGroup & shape2.collisionMask` and
	 * `shape2.collisionGroup & shape1.collisionMask` are not zero.
	 */
	collisionGroup: number;

	/**
	 * The collision mask bits of the shape. This is used for collision
	 * filtering.
	 *
	 * Two shapes `shape1` and `shape2` will collide only if both
	 * `shape1.collisionGroup & shape2.collisionMask` and
	 * `shape2.collisionGroup & shape1.collisionMask` are not zero.
	 */
	collisionMask: number;

	/**
	 * The contact callback of the shape. The callback methods are called
	 * when contact events the shape is involved occurred.
	 */
	contactCallback: ContactCallback;

	/**
	 * Default constructor.
	 */
	constructor() {
		this.position = new Vec3();
		this.rotation = new Mat3();
		this.friction = Setting.defaultFriction;
		this.restitution = Setting.defaultRestitution;
		this.density = Setting.defaultDensity;
		this.collisionGroup = Setting.defaultCollisionGroup;
		this.collisionMask = Setting.defaultCollisionMask;
		this.geometry = null;
		this.contactCallback = null;
	}
}
